<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="charset=UTF-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
</head>
<script src="<?php echo $_BASE_DIR?>javascripts/jquery.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
function set(acctname,sipcode,num,desc)
{
	$.get('<?php echo url("admin::cbquick/set")?>',{acctname: acctname, sipcode: sipcode, num: num, desc: desc },function(data){alert(data);});
	}
</script>
<?php 
	$acctuser = Acctuser::find('acctname = ?',$_SESSION['acct']['acctname'])->getOne();

?>
<body>
<a href="<?php echo url('mobile::wap/index',array('md5'=>$_SESSION['acct']['acctname'].'|'.$_SESSION['acct']['password']))?>">我的主页</a>
欢迎回来:<?php echo $_SESSION['acct']['acctname']?>,您当前余额:<?php echo $acctuser->balance;?>
<hr/>
<table class="table" width="600" >
		<thead>
			<tr>
				<td>序号</td>
				<td>亲情号码</td>
				<td>我的绑定</td>
				<td>姓名</td>
			</tr>
		</thead>
		<tbody>
		<?php 
			$acctname = $_SESSION['acct']['acclevel'] == 3 ? $_SESSION['acct']['acctname'] : ($_REQUEST['acctname']); 
			
			?>
			<?php foreach ($data as $k=>$v):?>
			<tr target="id">
				
				<td><?php echo $v->sipcode?></td>
				<td><?php echo $v->sipnum;?> </td>
				<?php 
					$usernum = Cbbind::find('acctname = ? and sipnum=?',$acctname,$v->sipcode)->getOne();
					
					$num = $usernum->bindnum ? $usernum->bindnum : '';
					$desc = $usernum->desc ? $usernum->desc : '';
				?>
				<td><input type="text" size="12" name="num_<?php echo $v->sipcode;?>" value="<?php echo $num;?>" id="num_<?php echo $v->sipcode;?>"  />
				<?php if($num):?>
				<a href="<?php echo url("mobile::wap/call",array('phone'=>$num))?>">拨打</a> 
				<?php endif;?>
				</td>
				<td><input type="text" size="12" name="desc_<?php echo $v->sipcode;?>" value="<?php echo $desc;?>" id="desc_<?php echo $v->sipcode;?>"  /> <input type="button" value="修改" onclick="set('<?php echo $acctname;?>','<?php echo $v->sipnum?>',$('#num_<?php echo $v->sipcode;?>').val(),$('#desc_<?php echo $v->sipcode;?>').val());" /></td>
				
			</tr>
			<?php endforeach;?>
		</tbody>
	</table>

</body></html>